package com.fqgj.xjd.user.client.enums;

import java.util.Objects;

public enum CarrierStatusEnum2 {
    INIT(0, "Init"), // 初始状态
    DONE(1, "Done"), // 完成认证
    NOT_AUTHORIZED(2, "Unverified"),// 未认证
    DOING(8, "In-processing"); //正在爬取;

    private Integer code;
    private String desc;

    CarrierStatusEnum2(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static CarrierStatusEnum2 getByCode(Integer code) {
        for (CarrierStatusEnum2 statusEnum2 : CarrierStatusEnum2.values()) {
            if (Objects.equals(statusEnum2.getCode(), code)) {
                return statusEnum2;
            }
        }
        return null;
    }
}
